<extend name="Base/common"/>
<block name="style">
<link href="__CSS__/lyz.calendar.css" rel="stylesheet" type="text/css" />
<style type="text/css">
    .head_head{
        height:20%;
        width:100%;

    }
    .head_label{
        width: 100%;
        display: block;
        text-align: center;
        font-size: 16px;

    }
    .head_value{
        width: 100%;
        margin-top: -15px;
        display: block;
        text-align: center;
        font-size: 30px;
        color:#000;

    }
    .head_daoqi{
        width: 100%;
        display: block;
        height:20px;
        margin-top: -15px;
        text-align: center;
        font-size: 12px;


    }
    .text{
    	float: left;
    	width:100%;
    	height:20px;
    	color:orange;
    	font-size: 12px;
    	line-height: 20px;
    	text-align: left;
        margin-left:5px;
    }

        table{

    font-size: 12px;

    font-family: "微软雅黑", "宋体", "Arial Narrow";
    
    }
    table th{
    padding:0px;
    border:none;
    }
    table td{
    padding:0px;
    
    }
    select{
        width: 10%;
        height: 21px;
        background:#B0E2FF;
        float: left;
        border:1px solid #ccc;
        border-radius: 30% 30%;
        margin-top:5px;
        margin-left:5px;
        font-size: 12px;
        padding-left: 1.5%
        
    }
    option{
        width:100%;
        text-align: center;
    }

    button{
        width: 10%;
        height: 21px;
        background: #EDEDED;
        border-left: none;
        float: left;
        margin-top:5px;
        margin-left:5px;
        font-size: 12px;
        text-align: center;
    }
</style>
<script src="http://www.jq22.com/jquery/1.4.4/jquery.min.js"></script>

<script src="__JS__/lyz.calendar.min.js" type="text/javascript"></script>
</block>
<block name="body">

    <div style="width:100%;height:40px;">
            <span class="text" style="width:100%;color:#111;margin-left:5px;">您的账单</span>
        
            <span class="text">今日花呗总交易量：<php>
                    $time1=strtotime(date("Ymd",strtotime("+1 day")));
                    $time2=strtotime(date("Ymd"));
                    $td_money=D('Dingdan')->where("status=1 and pay_time between $time2 and $time1")->sum('pay_money');
                    echo $td_money;
            </php></span>

        <div style="height:1px;width:100%;border-bottom:1px solid #c9caca;clear:both"></div>

    </div>



	<notempty name="list">
        <foreach name="list" item="vo" >
        	<php>
                $one=D('Dingdan')->where(['trade_no'=>$vo['trade_no']])->find();
                if(empty($one)){
                    $one=D('Xyk')->where(['trade_no'=>$vo['trade_no']])->find();
                }
        		$id=$one['danhao'];
        		$type=1;
        		$url="http://hbxyk.hihaoge.me/index.php?m=Weixin&c=Koubei&a=dingdan_view2&id=$id&type=$type";
        	</php>
            <a href="{$url}" style="background:url(__IMG__/you.png) no-repeat fixed right;">
                
                <div class="weui-form-preview__bd" style="position:relative;padding:0px 10px;">
                    <div style="width:30px;height:30px;float:left;margin-top:3%;margin-right:5px;">
                        <php>
                                $img='ding.png';
                        </php>
                        <img src="__IMG__/koubei/{$img}" >
                    </div>
                    <div class="weui-form-preview__item" style="width:89%;">
                        <label class="weui-form-preview__label" style="height:25px;font-size:16px;color:#434242;text-align-last: left;">
                        	<php>echo "订单";</php>
                        </label>
                        <em class="weui-form-preview__value" style="height:25px;font-size:16px;color:#434242;margin-right:12px;">
                        	<php>echo $vo['money']-2;</php>
							

                        </em>
                    </div>

                    <div class="weui-form-preview__item" style="width:89%;">
                        <label class="weui-form-preview__label" style="height:25px;text-align-last: left;">
                        	<php>if($one['pay_time']==''){
							}else{
								echo date("Y-m-d H:i:s",$one['pay_time']);
							}</php>
                        </label>
                        <em class="weui-form-preview__value" style="height:25px;font-size:14px;color:#434242;margin-right:12px;">
                        	<php>if($vo['status']==1){
								echo "<font style='color:green'>成功</font>";
							}elseif($vo['status']==0){
								echo "<font style='color:red'>失败</font>";
							}</php>
                        </em>
                        
                        
                    </div>
                    <img src="__IMG__/you.png" style="height:100%;width:8px;position:absolute;ringht:0;top:-2px;">


                </div>
                <div style="height:1px;width:100%;border-bottom:1px solid #c9caca;"></div>

            </a>
        </foreach>
       <else/>
        <div class="page__bd">
            <div class="weui-loadmore weui-loadmore_line">
                <span class="weui-loadmore__tips">暂无订单</span>
            </div>
        </div>
        </notempty>

        <div class="page"  style="float:left;width:auto;height:30px;opacity:1;position:relative">{$_page}</div>

</block>



<block name="script">

<script>

$('.search_btn').click(function(){
	var start_time=$('#txtBeginDate').val();
    var died_time =$('#txtEndDate').val();
    var status    =$('#status').val();
    var type      =$('#type').val();
    var danhao    =$('#danhao').val();
	
	location.href="http://hbxyk.hihaoge.me/index.php?m=Weixin&c=Koubei&a=dingdan&start_time="+start_time+"&died_time="+died_time+"&status="+status+"&type="+type+"&danhao="+danhao


})




</script>



<script>

    $(function () {

        $("#txtBeginDate").calendar({

            controlId: "divDate",                                 // 弹出的日期控件ID，默认: $(this).attr("id") + "Calendar"

            speed: 200,                                           // 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000),默认：200

            complement: true,                                     // 是否显示日期或年空白处的前后月的补充,默认：true

            readonly: true,                                       // 目标对象是否设为只读，默认：true

            upperLimit: new Date(),                               // 日期上限，默认：NaN(不限制)

            lowerLimit: new Date("2011/01/01"),                   // 日期下限，默认：NaN(不限制)

            callback: function () {                               // 点击选择日期后的回调函数

                // alert("您选择的日期是：" + $("#txtBeginDate").val());

            }

        });

        $("#txtEndDate").calendar();

    });

</script>
	
</block>